package cn.edu.stu.contorller.system;

import cn.edu.stu.bean.AjaxResult;
import cn.edu.stu.bean.MicArtist;
import cn.edu.stu.service.ArtistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Karl
 * @Date 2022/12/17 - 14:53
 */
@RestController
@RequestMapping("/artist")
public class ArtistController {
    @Autowired
    ArtistService artistService;

    @RequestMapping("/like")
    public AjaxResult getArtistByFuzzyName(@RequestParam("name")String name){
            AjaxResult success = AjaxResult.success();
            if(name==null||"".equals(name))
                return success;
            List<MicArtist> artists = artistService.getArtistByFuzzyName(name);
            success.put("artists",artists);
            return success;
    }
}
